Skip to content

[apiserver] Start apiserver v2 in apiserver/cmd/main.go #3603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 21, 2025

Conversation

troychiu
Copy link
Contributor

@troychiu troychiu commented May 14, 2025

Why are these changes needed?

This PR start apiserver v2 in apiserver/cmd/main.go to ship the apiserver v2.

Related issue number

Closes #3596

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

Signed-off-by: Troy Chiu <[email protected]>
@troychiu troychiu changed the title use apiserversdk [apiserver] use apiserversdk May 14, 2025
@troychiu troychiu changed the title [apiserver] use apiserversdk [apiserver] Start apiserver v2 in apiserver/cmd/main.go May 14, 2025
@troychiu troychiu marked this pull request as ready for review May 14, 2025 17:20
@troychiu
Copy link
Contributor Author

@rueian could you take a look? Thank you

Signed-off-by: Troy Chiu <[email protected]>
@troychiu troychiu requested a review from rueian May 14, 2025 18:18
Copy link
Contributor

@rueian rueian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@troychiu
Copy link
Contributor Author

@kevin85421 PTAL thank you!

Signed-off-by: Troy Chiu <[email protected]>
Copy link
Member

@kevin85421 kevin85421 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chatted with @rueian yesterday. Our conclusions are:

  • v1.4.0 is the last release where we fix bugs and add new features for v1.
  • We want to launch both v1 and v2 at the same time so that users can incrementally migrate from v1 to v2, and don't need to be 100% one time.
  • We don't want to create a new quay repository such as kuberay/apiserverv2. This may increase the complexity of migration.
  • For v1.5.0, the image ``kuberay/apiserver` will be v2 only.

@@ -144,8 +146,19 @@ func startHttpProxy() {
registerHttpHandlerFromEndpoint(ctx, api.RegisterRayServeServiceHandlerFromEndpoint, "ServeService", runtimeMux)
registerHttpHandlerFromEndpoint(ctx, api.RegisterRayJobSubmissionServiceHandlerFromEndpoint, "RayJobSubmissionService", runtimeMux)

kubernetesConfig, err := config.GetConfig()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add a feature gate (maybe a env var) for users to disable v2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a flag instead, since that has been a pattern in api server

troychiu added 3 commits May 18, 2025 22:25
Signed-off-by: Troy Chiu <[email protected]>
Signed-off-by: Troy Chiu <[email protected]>
apiserver/go.mod Outdated
@@ -28,6 +25,8 @@ require (
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3
github.com/onsi/gomega v1.37.0
github.com/ray-project/kuberay/apiserversdk v0.0.0-20250519054718-f3ebea713a2f
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since apiserversdk hasn't been released. I use the master commit instead.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it mean that the apiserver image uses different commits for apiserver v1 and v2? If so, it may cause some very hard to debug issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fortunately #3640 solve this!

Signed-off-by: Troy Chiu <[email protected]>
@troychiu troychiu requested review from rueian and kevin85421 May 20, 2025 06:42
Signed-off-by: Troy Chiu <[email protected]>
@troychiu
Copy link
Contributor Author

cc @kevin85421

@@ -133,6 +133,32 @@ rules:
- get
- list
---
# apiserversdk requires the following permissions to be able to list and proxy services
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to update Helm chart's RBAC? If you plan to open a follow up PR for Helm chart, can you open an issue to track the progress?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think we should. Thank you for catching this. Let me create an issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #3648

apiserver/go.mod Outdated
@@ -28,6 +25,8 @@ require (
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3
github.com/onsi/gomega v1.37.0
github.com/ray-project/kuberay/apiserversdk v0.0.0-20250519054718-f3ebea713a2f
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it mean that the apiserver image uses different commits for apiserver v1 and v2? If so, it may cause some very hard to debug issues.

corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

"github.com/ray-project/kuberay/apiserver/test/e2e"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid importing apiserver? The payoff will come when we start deprecating v1. I am OK to add a file to add some test utils which copy some functions from apiserver/test/e2e.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's a good point. I copied some utilities to e2e/apiserversdk and removed the unnecessary parts.

troychiu added 3 commits May 20, 2025 23:52
Signed-off-by: Troy Chiu <[email protected]>
Signed-off-by: Troy Chiu <[email protected]>
Signed-off-by: Troy Chiu <[email protected]>
@kevin85421
Copy link
Member

cc @rueian would you mind reviewing another iteration? Thanks!

Signed-off-by: Troy Chiu <[email protected]>
@kevin85421
Copy link
Member

@troychiu please ping me when all CI tests pass.

@troychiu
Copy link
Contributor Author

@kevin85421 they passed! Thank you!

@kevin85421 kevin85421 merged commit 2ef997b into ray-project:master May 21, 2025
24 checks passed
pawelpaszki pushed a commit to opendatahub-io/kuberay that referenced this pull request May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[apiserversdk] Start apiserver v2 in apiserver/cmd/main.go
3 participants